package com.xingbg.projectimpl.config.controller;

import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * @author yuqi138
 * @version 1.0
 * @Description:一句话描述这个类的作用
 * @date 2021/5/26 16:40
 * @Copyright: 2021 www.jddglobal.com|www.haiyi-info.com Inc.All rights reserved.
 */
public class LiskovWebMvcConfigurationSupport extends WebMvcConfigurationSupport{

    private String[] basePackages;

    public LiskovWebMvcConfigurationSupport(String[] basePackages){
        this.basePackages = basePackages;
    }

    @Override
    public RequestMappingHandlerMapping requestMappingHandlerMapping() {
        LiskovRequestMappingHandlerMapping handlerMapping = new LiskovRequestMappingHandlerMapping(basePackages);
        handlerMapping.setOrder(0);
        handlerMapping.setInterceptors(getInterceptors());
        return handlerMapping;
    }
}
